package com.qianli.cashmama.trade.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.qianli.cashmama.trade.dao.TDiscountDao;
import com.qianli.cashmama.trade.entity.TDiscountEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * User: sm
 * Date: 2017-07-21
 * Time: 09:10:21.139
 */

@Repository
public class TDiscountDaoImpl extends AbstractBaseMapper<TDiscountEntity> implements TDiscountDao {
    @Override
    public TDiscountEntity selectOneByTradeNo(String tradeNo) {
        Map<String, Object> map = new HashMap<>();
        map.put("tradeNo", tradeNo);
        return getSqlSession().selectOne(getStatement("selectOneByTradeNo"), map);
    }


    @Override
    public List<TDiscountEntity> selectListByTradeNo(String tradeNo) {
        Map<String, Object> map = new HashMap<>();
        map.put("tradeNo", tradeNo);
        return getSqlSession().selectList(getStatement("selectListByTradeNo"), map);
    }

    @Override
    public Integer updateByTradeNoAndDiscountCode(TDiscountEntity tDiscountEntity) {
        return getSqlSession().update(getStatement("updateByTradeNoAndDiscountCode"), tDiscountEntity);
    }
}